<?php
require_once '../app/class.template.php';

$res = Template::getList('en');
p($res, 'getList');

$res = Template::save('en', 'test', 'Description', 'Subject', 'Body...');
p($res, 'save');

$res = Template::getOne('en', 'test');
p($res, 'getOne');

$res = Template::save('en', 'test', 'Description 2', 'Subject 2', 'Body... 2');
p($res, 'save (update)');

$res = Template::getOne('en', 'test');
p($res, 'getOne (updated)');

$res = Template::delete('en', 'test');
p($res, 'delete');

$res = Template::getList('en');
p($res, 'getList');



function p($data, $title)
{
    echo '<h3>' . $title . '</h3>';
    echo '<pre>';
    print_r($data);
    echo '</pre><br/>';
}